<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableTopics extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('topics', function (Blueprint $table) {
            $table->increments('tid');      // 主键
            $table->integer('uid');         // 用户id
            $table->string('title', 50);    // 话题
            $table->text('desc');           // 描述
            $table->tinyInteger('type');    // 1单选，2多选
            $table->tinyInteger('is_pic')->default(0);  // 0文字，1图片
            $table->integer('pub_time');    // 发布时间
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('topics');
    }
}
